#include "Targetdetection.h"



char TargetDetectionBuf[512] = { 0 };

void TargetDetectionInit()
{
    Uart_init(TargetDetect_uart_num, TargetDetect_buad, TargetDetect_uart_tx, TargetDetect_uart_rx, 1);
}


TargetDetectionRes  GetTaretDetectRes(int* Movup)
{
    // GDR\n
    TargetDetectionRes res = 0;

    Uart_printf(TargetDetect_uart_num, "GDR\n");
    Uart_readLine(TargetDetect_uart_num, TargetDetectionBuf, 511, 0);
    sscanf(TargetDetectionBuf, "TD:%d,%d\n", &res, Movup);
    return res;
}